package com;

import java.awt.Color;

public class Auto {

	public int luntai;
	public Color color;
	public double weight;
	public int speed;

	public Auto(int luntai, Color color, double weight, int speed) {
		this.luntai = luntai;
		this.color = color;
		this.weight = weight;
		
	}
	public void jiasu() {
		speed += 10;
	}
	public void jiansu() {
		speed -= 10;
	}
	public void stop() {
		speed = 0;
	}
	public String getState() {
		String s = "轮胎个数：" + luntai + "\n" + "颜色：" + color.toString() + "\n" + "重量：" + weight + "\n" + "状态：";
		if (speed == 0)
			s = s + "停止" + "\n";
		else
			s = s + "运行中" + "\n";
		return s;
	}
}
